package com.wang.service.Impl;

import com.wang.dao.ExpertEntityDao;
import com.wang.dao.ExpertTypeEntityDao;
import com.wang.domain.ExpertEntity;
import com.wang.domain.ExpertTypeEntity;
import com.wang.service.IExpertService;
import com.wang.service.IService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2017/2/11 0011.
 */
@Service
public class ExpertTypeServiceImpl implements IService<ExpertTypeEntity> {

    @Autowired
    private ExpertTypeEntityDao expertTypeDao;

    @Override
    public Page<ExpertTypeEntity> findAll()
    {
        return expertTypeDao.findAll(new PageRequest(0,Integer.MAX_VALUE, Sort.Direction.ASC,"id"));
    }

    @Override
    public ExpertTypeEntity add(ExpertTypeEntity entity) {
        return expertTypeDao.save(entity);
    }

    @Override
    public ExpertTypeEntity edit(ExpertTypeEntity entity) {
        return expertTypeDao.save(entity);
    }

    @Override
    public void delete(ExpertTypeEntity entity) {
        expertTypeDao.delete(entity);
    }

}
